package com.eorchis.util;

import java.io.OutputStream;
import java.io.Writer;

import javax.xml.namespace.NamespaceContext;
import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
import javax.xml.transform.Result;

public class XMLStreamWriterDelegate implements XMLStreamWriter {

	private XMLStreamWriter streamWriter = null;

	public XMLStreamWriterDelegate(Writer stream) {
		try {
			streamWriter = XMLOutputFactory.newInstance().createXMLStreamWriter(stream);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

	public XMLStreamWriterDelegate(OutputStream stream) {
		try {
			streamWriter = XMLOutputFactory.newInstance().createXMLStreamWriter(stream);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

	public XMLStreamWriterDelegate(OutputStream stream, String encoding) {
		try {
			streamWriter = XMLOutputFactory.newInstance().createXMLStreamWriter(stream, encoding);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

	public XMLStreamWriterDelegate(Result result) {
		try {
			streamWriter = XMLOutputFactory.newInstance().createXMLStreamWriter(result);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

	public void close() throws XMLStreamException {
		streamWriter.close();
	}

	public void flush() throws XMLStreamException {
		streamWriter.flush();
	}

	public NamespaceContext getNamespaceContext() {
		return streamWriter.getNamespaceContext();
	}

	public String getPrefix(String arg0) throws XMLStreamException {
		return streamWriter.getPrefix(arg0);
	}

	public Object getProperty(String arg0) throws IllegalArgumentException {
		return streamWriter.getProperty(arg0);
	}

	public void setDefaultNamespace(String arg0) throws XMLStreamException {
		streamWriter.setDefaultNamespace(arg0);
	}

	public void setNamespaceContext(NamespaceContext arg0) throws XMLStreamException {
		streamWriter.setNamespaceContext(arg0);
	}

	public void setPrefix(String arg0, String arg1) throws XMLStreamException {
		streamWriter.setPrefix(arg0, arg1);
	}

	public void writeAttribute(String arg0, String arg1, String arg2, String arg3) throws XMLStreamException {
		streamWriter.writeAttribute(arg0, arg1, arg2, arg3);
	}

	public void writeAttribute(String arg0, String arg1, String arg2) throws XMLStreamException {
		streamWriter.writeAttribute(arg0, arg1, arg2);
	}

	public void writeAttribute(String arg0, String arg1) throws XMLStreamException {
		streamWriter.writeAttribute(arg0, arg1);
	}

	public void writeCData(String arg0) throws XMLStreamException {
		streamWriter.writeCData(arg0);
	}

	public void writeCharacters(char[] arg0, int arg1, int arg2) throws XMLStreamException {
		streamWriter.writeCharacters(arg0, arg1, arg2);
	}

	public void writeCharacters(String arg0) throws XMLStreamException {
		streamWriter.writeCharacters(arg0);
	}

	public void writeComment(String arg0) throws XMLStreamException {
		streamWriter.writeComment(arg0);
	}

	public void writeDTD(String arg0) throws XMLStreamException {
		streamWriter.writeDTD(arg0);
	}

	public void writeDefaultNamespace(String arg0) throws XMLStreamException {
		streamWriter.writeDefaultNamespace(arg0);
	}

	public void writeEmptyElement(String arg0, String arg1, String arg2) throws XMLStreamException {
		streamWriter.writeEmptyElement(arg0, arg1, arg2);
	}

	public void writeEmptyElement(String arg0, String arg1) throws XMLStreamException {
		streamWriter.writeEmptyElement(arg0, arg1);
	}

	public void writeEmptyElement(String arg0) throws XMLStreamException {
		streamWriter.writeEmptyElement(arg0);
	}

	public void writeEndDocument() throws XMLStreamException {
		streamWriter.writeEndDocument();
	}

	public void writeEndElement() throws XMLStreamException {
		streamWriter.writeEndElement();
	}

	public void writeEntityRef(String arg0) throws XMLStreamException {
		streamWriter.writeEntityRef(arg0);
	}

	public void writeNamespace(String arg0, String arg1) throws XMLStreamException {
		streamWriter.writeNamespace(arg0, arg1);
	}

	public void writeProcessingInstruction(String arg0, String arg1) throws XMLStreamException {
		streamWriter.writeProcessingInstruction(arg0, arg1);
	}

	public void writeProcessingInstruction(String arg0) throws XMLStreamException {
		streamWriter.writeProcessingInstruction(arg0);
	}

	public void writeStartDocument() throws XMLStreamException {
		streamWriter.writeStartDocument();
	}

	public void writeStartDocument(String arg0, String arg1) throws XMLStreamException {
		streamWriter.writeStartDocument(arg0, arg1);
	}

	public void writeStartDocument(String arg0) throws XMLStreamException {
		streamWriter.writeStartDocument(arg0);
	}

	public void writeStartElement(String arg0, String arg1, String arg2) throws XMLStreamException {
		streamWriter.writeStartElement(arg0, arg1, arg2);
	}

	public void writeStartElement(String arg0, String arg1) throws XMLStreamException {
		streamWriter.writeStartElement(arg0, arg1);
	}

	public void writeStartElement(String arg0) throws XMLStreamException {
		streamWriter.writeStartElement(arg0);
	}

}
